<?php
use DBConnection\DBConnection;
echo '<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Simple AJax Example</title>
<script type="text/javascript" src="AJax/AJax.js"></script>
</head>
<body>
	<div id="myDiv"></div>
	<input type="button" value="Random Number" onclick = "randNumber()">
	</br>
		
		
	<form action=""> 
	First name: <input type="text" id="txt1" onkeyup="showHint(this.value)">
	</form>
	<p>Suggestions: <span id="txtHint"></span></p> 
		
	<form action=""> 
	<select name="user" onchange="userDB(this.value)">
	<option value="">Select a user:</option>';
	
	$connection = DBConnection::getDBConnection();
	$sql = "select * from user";
	$stmt = $connection->prepare($sql);
	$stmt->execute();
	while ($row = $stmt->fetch())
		{
			echo "<option value =  \"". $row['name'] . "\">" . $row['name']. "</option>";
		}

	echo '</select>
	</form>
	<div id="userName">Customer info will be listed here...</div>
		
	
</body>
</html>';